<template>
	<view>
		<user-card :userinfo='userinfo' :expand="expand"></user-card>
		<grid :nav='nav'></grid>
		<uni-list>
			<uni-list-item title="地址管理" @click='goAddress'></uni-list-item>
			<uni-list-item title="我的订单" @click='goOrder'></uni-list-item>
			<!-- <uni-list-item title="设置" @click='goSetting'></uni-list-item> -->
			<!-- <uni-list-item title="关于" @click='goAbout'></uni-list-item> -->
		</uni-list>
	</view>
</template>

<script>
	import userCard from '@/components/shopComponents/mine/user-card.vue'
	import grid from '@/components/shopComponents/common/grid.vue'
	import uniList from '@/components/shopComponents/mine/uni-list.vue'
	import uniListItem from '@/components/shopComponents/mine/uni-list-item.vue'
	// import mockData from '@/data/mine.js'
	export default {
		components: {
			userCard,
			grid,
			uniList,
			uniListItem
		},
		data() {
			return {
				userinfo: {},
				expand: [],
				nav: [],
				userid:uni.getStorageSync("userid"),
			}
		},
		methods: {
			goOrder(){
				this.$jump('/pages/shopPages/order/order')
			},
			goAddress() {
				// this.$jump('/pages/shopPages/address/address-list/address-list')
				this.$jump('/pages/shop/select-address')
			},
			goSetting() {
				this.$jump('/pages/shopPages/setting/setting')
			},
			goAbout() {
				this.$jump('/pages/shopPages/about/about')
			},
			findCompanyInfo(){
				var _this=this;
				uni.request({
					url:this.$API.getUserDetail,
					method:"POST",
					data:{
						userid:_this.userid,
					},
					header:this.$API.get_head(),
					success: (res) => {
						_this.userinfo=res.data.data;
					},
					fail: () => {
						uni.showToast({
							title:"加载失败",
							icon:'none'
						})
					 }
				})
			}
		},
		onReady() {
			
			this.findCompanyInfo();
		}
	}
</script>

<style>

</style>
